<!DOCTYPE html>
<html class="index_body">
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=10">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <title>订单明细</title>
    <link rel="stylesheet" href="/Public/mui/computer/css/bootstrap.css"/>
    <link rel="stylesheet" href="/Public/mui/computer/css/index.css"/>
    <link rel="stylesheet" href="/Public/mui/css/page.css"/>
    <link rel="stylesheet"  href="/Public/mui/static/bower_components/sweetalert/dist/sweetalert.css">
    <link rel="stylesheet" type="text/css" href="/Public/mui/modalframe/css/default.css" />
    <link rel="stylesheet" type="text/css" href="/Public/mui/modalframe/css/component.css" />
</head>
<body class="index_body">
<include file="Lay:heder" />
<div class="container" style="width: 100%;">
    <!-- <div class="md-modal md-effect-1" id="modal-1">
        <div class="md-content">
            <div class="images_content" style="width: 600px;height:600px;">
            <h3>图片展示</h3><button class="md-close" style="width: 100%;">取消</button>
                <img id="imgmodeltanchu" src="" alt="" style="width:100%;height:100%;margin:0 auto;">
            </div>
        </div>
    </div> -->
    <div id="section" style="padding-top: 20px">
        <table class="table table-hover table-bordered table_tong">
            <thead>
            <tr>
                <th>订单信息</th>
                <th>订单号</th>
                <th>所属省市</th>
                <th>车库位置</th>
                <th>顾问姓名</th>
                <th>顾问岗位号</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td></td>
                <td>{{$order_data['orderid']}}</td>
                <td>{{$order_data['provinceid']}} / {{$order_data['cityid']}}</td>
                <td>{{$order_data['soket']?$order_data['soket']:临时购车}}</td>
                <td>{{$order_data['GWname']}}</td>
                <td>{{$order_data['GWnum']}}</td>
            </tr>
            </tbody>
        </table>
        <table class="table table-hover table-bordered table_tong">
            <thead>
            <tr>
                <th>车辆信息</th>
                <th>姓名</th>
                <th>性别</th>
                <th>车辆名称</th>
                <th>车辆颜色</th>
                <th>品牌</th>
                <th>金融方案</th>
                <th>优优价</th>
                <th>首付</th>
                <th>月租金</th>
                <th>还款期数</th>
                <th>进件计算表</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td></td>
                <td>{{$order_data['nickname']}}</td>
                <td>{{$order_data['sex']}}</td>
                <td>{{$order_data['carname']}}</td>
                <td>{{$order_data['colors']}}</td>
                <td>{{$order_data['content']}}</td>
                <td>{{$order_data['buy_type']}}</td>
                <td>{{$order_data['uu_price']?0:"--"}}</td>
                <td>{{$order_data['first_pay']?0:"--"}}</td>
                <td>{{$order_data['month_pay']?0:"--"}}</td>
                <td>{{$order_data['pay_month']?0:"--"}}</td>
                <td><if condition="$entrycount gt 0">
                        <for start="0" end="$entrycount">
                            <!-- <a href="{{$user_data['workproof_url'][$i]}}" target="_blank">图 {{$i+1}}</a> -->
                            <a class="md-trigger" data-modal="modal-1" onclick="ejectmodel('{{$user_data['oss_url']}}{{$user_data['entry_url'][$i]}}')">图 {{$i+1}}</a>
                        </for>
                    </if>
                </td>
            </tr>
            </tbody>
        </table>
        <include file="News:news" />
        <input type="hidden" name="remark" value="">
        <div class="btnK" style="width: 300px;">
            <button type="button" class="btn btn-success navbar-btn"    onclick="isGetOrder(1);">通过</button>
            <button type="button" class="btn btn-orange navbar-btn"     onclick="isGetOrder(-2);" style="background-color: orange;color:#fff">驳回订单</button>
        </div>
    </div>
</div>
<div class="mask-layer" style="display: none">
    <div class="mask-layer-black"></div>
    <div class="mask-layer-container">
        <div class="mask-layer-container-operate">
            <!-- <button class="mask-prev btn-default-styles" style="float: left">上一张</button> -->
            <button class="mask-out btn-default-styles">放大</button>
            <button class="mask-in btn-default-styles">缩小</button>
            <button class="mask-clockwise btn-default-styles">顺旋转</button>
            <button class="mask-counterclockwise btn-default-styles">逆旋转</button>
            <button class="mask-close btn-default-styles">关闭</button>
            <!-- <button class="mask-next btn-default-styles" style="float: right">下一张</button> -->
        </div>
        <div class="mask-layer-imgbox auto-img-center">
            <p>
                <img id="imgmodeltanchu" src="" alt="" style="width: 620px; margin-top: 43.5px;height: 100%">
            </p >
        </div>
    </div>
</div>
<script src="/Public/mui/computer/js/jquery-1.11.3.js"></script>
<script type="text/javascript" src="/Public/mui/static/bower_components/sweetalert/dist/sweetalert.min.js"></script>
<script type="text/javascript" src="/Public/mui/computer/js/functions.js"></script>
<script src="/Public/mui/computer/js/back.js"></script>
<!-- <script src="/Public/mui/modalframe/js/classie.js"></script>
<script src="/Public/mui/modalframe/js/modalEffects.js"></script> -->
<script src="/Public/mui/computer/js/enlarge.js"></script>
<script>
    var use = "{{$user_data['usertype']}}";
    if(use != 0){
        $(".usetype").css("display","none");
    }
    function isGetOrder(status){
        swal({title: "确定修改订单的状态吗？",text: "修改后将立即生效并跳转到列表页面。", type: "warning",showCancelButton: true, confirmButtonColor: "#DD6B55",confirmButtonText: "是的",cancelButtonText: "取消", closeOnConfirm: false},
          function(){
            var orderid = "{{$order_data['orderid']}}";

            if(orderid == ""){
                sweetAlert('','对不起,操作有误,请重新刷新页面','error');return false;
            }

            var remark = $('input[name="remark"]').val();
            if(status==-2&&remark==''){
                swal({ 
                  title: "备注", 
                  text: "为什么驳回？",
                  type: "input", 
                  confirmButtonText: "好了",
                  cancelButtonText: "取消",
                  showCancelButton: true, 
                  closeOnConfirm: false, 
                  animation: "slide-from-top", 
                  inputPlaceholder: "请简单说明为什么驳回。"
                },
                function(inputValue){ 
                  if(inputValue!=""&&inputValue){
                    $('input[name="remark"]').val(inputValue);
                    data = {'orderid':orderid,'status':status,'remark':inputValue}
                    sendStatus(data);
                  }
                });
                return false;
            }else if(status==1&&remark==''){
                swal({ 
                  title: "通过备注", 
                  text: "为什么通过？",
                  type: "input", 
                  confirmButtonText: "好了",
                  cancelButtonText: "不填",
                  showCancelButton: true, 
                  closeOnConfirm: false, 
                  animation: "slide-from-top", 
                  inputPlaceholder: "请简单说明为什么通过。"
                },
                function(inputValue){ 
                    $('input[name="remark"]').val(inputValue);
                    data = {'orderid':orderid,'status':status,'remark':inputValue}
                    sendStatus(data);
                });
                return false;
            }else if(status==-1&&remark==''){
                swal({ 
                  title: "通过拒绝", 
                  text: "为什么拒绝？",
                  type: "input", 
                  confirmButtonText: "好了",
                  cancelButtonText: "不填",
                  showCancelButton: true, 
                  closeOnConfirm: false, 
                  animation: "slide-from-top", 
                  inputPlaceholder: "请简单说明为什么拒绝。"
                },
                function(inputValue){ 
                    $('input[name="remark"]').val(inputValue);
                    data = {'orderid':orderid,'status':status,'remark':inputValue}
                    sendStatus(data);
                });
                return false;
            }

          });
    }

    function sendStatus(data) {
        post("setFinanceAudit",data,function(res){
                console.log(res);
                if(res['ret'] == 1){
                    sweetAlert('','操作成功','success');
                    setTimeout(function () {
                      location.href = '/admin/order/getAdjustAccounts';
                    },3000);
                }else if(res == 2){
                    sweetAlert('','订单已做修改,请刷新重新获取资料','error');

                    return false;
                }else{
                    window.location.href="/admin/order/getAdjustAccounts";
                }
            });
    }
    var adminshowznum1 = 0;
    function ejectmodel(id){
        document.getElementById("imgmodeltanchu").src=id;
        $('.mask-layer').show();
    }
    
    $("body").delegate(".images_content>img","click",function(){
        adminshowznum1 ++;
        this.style.transform = 'rotate('+90*adminshowznum1+'deg)';
    });
</script>
</body>
</html>